home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 January: Mac OS SDK / Dev.CD Jan 99 SDK1.toast / Development Kits / Interfaces&Libraries / Universal / Interfaces / PInterfaces / AppleScript.p < prev    next >
Encoding:
Text File  |  1998-08-17  |  5.4 KB  |  179 lines  |  [TEXT/MPS ]

  1. {
  2.      File:        AppleScript.p
  3.  
  4.      Contains:    AppleScript Specific Interfaces.
  5.  
  6.      Version:    Technology:    AppleScript 1.1
  7.                  Release:    Universal Interfaces 3.2
  8.  
  9.      Copyright:    © 1992-1998 by Apple Computer, Inc., all rights reserved
  10.  
  11.      Bugs?:        For bug reports, consult the following page on
  12.                  the World Wide Web:
  13.  
  14.                      http://developer.apple.com/bugreporter/
  15.  
  16. }
  17. {$IFC UNDEFINED UsingIncludes}
  18. {$SETC UsingIncludes := 0}
  19. {$ENDC}
  20.  
  21. {$IFC NOT UsingIncludes}
  22.  UNIT AppleScript;
  23.  INTERFACE
  24. {$ENDC}
  25.  
  26. {$IFC UNDEFINED __APPLESCRIPT__}
  27. {$SETC __APPLESCRIPT__ := 1}
  28.  
  29. {$I+}
  30. {$SETC AppleScriptIncludes := UsingIncludes}
  31. {$SETC UsingIncludes := 1}
  32.  
  33. {$IFC UNDEFINED __ERRORS__}
  34. {$I Errors.p}
  35. {$ENDC}
  36. {$IFC UNDEFINED __APPLEEVENTS__}
  37. {$I AppleEvents.p}
  38. {$ENDC}
  39. {$IFC UNDEFINED __OSA__}
  40. {$I OSA.p}
  41. {$ENDC}
  42. {$IFC UNDEFINED __TEXTEDIT__}
  43. {$I TextEdit.p}
  44. {$ENDC}
  45.  
  46.  
  47. {$PUSH}
  48. {$ALIGN MAC68K}
  49. {$LibExport+}
  50.  
  51. {*************************************************************************
  52.     Types and Constants
  53. *************************************************************************}
  54. {
  55.     The specific type for the AppleScript instance of the
  56.     Open Scripting Architecture type.
  57. }
  58.  
  59. CONST
  60.     typeAppleScript                = 'ascr';
  61.     kAppleScriptSubtype            = 'ascr';
  62.     typeASStorage                = 'ascr';
  63.  
  64. {*************************************************************************
  65.     Component Selectors
  66. *************************************************************************}
  67.  
  68.     kASSelectInit                = $1001;
  69.     kASSelectSetSourceStyles    = $1002;
  70.     kASSelectGetSourceStyles    = $1003;
  71.     kASSelectGetSourceStyleNames = $1004;
  72.  
  73.  
  74. {*************************************************************************
  75.     OSAGetScriptInfo Selectors
  76. *************************************************************************}
  77.     kASHasOpenHandler            = 'hsod';
  78.  
  79. {
  80.         This selector is used to query a context as to whether it contains
  81.         a handler for the kAEOpenDocuments event. This allows "applets" to be 
  82.         distinguished from "droplets."  OSAGetScriptInfo returns false if
  83.         there is no kAEOpenDocuments handler, and returns the error value 
  84.         errOSAInvalidAccess if the input is not a context.
  85.     }
  86. {*************************************************************************
  87.     Initialization
  88. *************************************************************************}
  89. FUNCTION ASInit(scriptingComponent: ComponentInstance; modeFlags: LONGINT; minStackSize: LONGINT; preferredStackSize: LONGINT; maxStackSize: LONGINT; minHeapSize: LONGINT; preferredHeapSize: LONGINT; maxHeapSize: LONGINT): OSAError;
  90.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  91.     INLINE $2F3C, $001C, $1001, $7000, $A82A;
  92.     {$ENDC}
  93. {
  94.         ComponentCallNow(kASSelectInit, 28);
  95.         This call can be used to explicitly initialize AppleScript.  If it is
  96.         not called, the a scripting size resource is looked for and used. If
  97.         there is no scripting size resource, then the constants listed below
  98.         are used.  If at any stage (the init call, the size resource, the 
  99.         defaults) any of these parameters are zero, then parameters from the
  100.         next stage are used.  ModeFlags are not currently used.
  101.         Errors:
  102.         errOSASystemError        initialization failed
  103.     }
  104. {
  105.     These values will be used if ASInit is not called explicitly, or if any
  106.     of ASInit's parameters are zero:
  107. }
  108.  
  109. CONST
  110.     kASDefaultMinStackSize        = 4096;
  111.     kASDefaultPreferredStackSize = 16384;
  112.     kASDefaultMaxStackSize        = 16384;
  113.     kASDefaultMinHeapSize        = 4096;
  114.     kASDefaultPreferredHeapSize    = 16384;
  115.     kASDefaultMaxHeapSize        = 33554432;
  116.  
  117. {*************************************************************************
  118.     Source Styles
  119. *************************************************************************}
  120. FUNCTION ASSetSourceStyles(scriptingComponent: ComponentInstance; sourceStyles: STHandle): OSAError;
  121.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  122.     INLINE $2F3C, $0004, $1002, $7000, $A82A;
  123.     {$ENDC}
  124. {
  125.         ComponentCallNow(kASSelectSetSourceStyles, 4);
  126.         Errors:
  127.         errOSASystemError        operation failed
  128.     }
  129. FUNCTION ASGetSourceStyles(scriptingComponent: ComponentInstance; VAR resultingSourceStyles: STHandle): OSAError;
  130.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  131.     INLINE $2F3C, $0004, $1003, $7000, $A82A;
  132.     {$ENDC}
  133. {
  134.         ComponentCallNow(kASSelectGetSourceStyles, 4);
  135.         Errors:
  136.         errOSASystemError        operation failed
  137.     }
  138. FUNCTION ASGetSourceStyleNames(scriptingComponent: ComponentInstance; modeFlags: LONGINT; VAR resultingSourceStyleNamesList: AEDescList): OSAError;
  139.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  140.     INLINE $2F3C, $0008, $1004, $7000, $A82A;
  141.     {$ENDC}
  142. {
  143.         ComponentCallNow(kASSelectGetSourceStyleNames, 8);
  144.         This call returns an AEList of styled text descriptors the names of the
  145.         source styles in the current dialect.  The order of the names corresponds
  146.         to the order of the source style constants, below.  The style of each
  147.         name is the same as the styles returned by ASGetSourceStyles.
  148.         
  149.         Errors:
  150.         errOSASystemError        operation failed
  151.     }
  152. {
  153.     Elements of STHandle correspond to following categories of tokens, and
  154.     accessed through following index constants:
  155. }
  156.  
  157. CONST
  158.     kASSourceStyleUncompiledText = 0;
  159.     kASSourceStyleNormalText    = 1;
  160.     kASSourceStyleLanguageKeyword = 2;
  161.     kASSourceStyleApplicationKeyword = 3;
  162.     kASSourceStyleComment        = 4;
  163.     kASSourceStyleLiteral        = 5;
  164.     kASSourceStyleUserSymbol    = 6;
  165.     kASSourceStyleObjectSpecifier = 7;
  166.     kASNumberOfSourceStyles        = 8;
  167.  
  168.  
  169. {$ALIGN RESET}
  170. {$POP}
  171.  
  172. {$SETC UsingIncludes := AppleScriptIncludes}
  173.  
  174. {$ENDC} {__APPLESCRIPT__}
  175.  
  176. {$IFC NOT UsingIncludes}
  177.  END.
  178. {$ENDC}
  179.